#pragma once

#include "operators/handle.h"

namespace txdnn {

/* Execution Context */ 
struct ExecutionContext {
public:
  ExecutionContext() { detectKernelType(); }
  ExecutionContext(const Handle* stream) : stream_(stream) { detectKernelType(); }

  ExecutionContext(const ExecutionContext&)             = default;
  ExecutionContext(ExecutionContext&&)                  = default;
  ExecutionContext& operator=(const ExecutionContext&)  = default;
  ExecutionContext& operator=(ExecutionContext&&)       = default;
  virtual ~ExecutionContext()                           = default;

  inline const Handle& getStream() const { return *stream_; }
  inline void setStream(Handle* stream) { stream_ = stream; }

  bool use_mainc_kernels_                               = false;
  bool use_txdnn_kernels_                               = false;
  bool use_intrinsic_kernels_                           = false;

  std::string compile_options_;

private:
  const Handle* stream_ = nullptr;

  // use high performance kernels if available, 
  // or fallback to mainc kernels if ENVironment variable is set
  void detectKernelType() {
    // TODO
    use_intrinsic_kernels_ = true;
  }

};

} // namespace txdnn